﻿using Smobiler.Core;
using Smobiler.Core.Controls;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAL;
using FubiManger.UI;

namespace FubiManger.Controls
{
    ////ToolboxItem用于控制是否添加自定义控件到工具箱，true添加，false不添加
    //[System.ComponentModel.ToolboxItem(true)]
    partial class classifycontrol : Smobiler.Core.Controls.MobileUserControl
    {
        public classifycontrol() : base()
        {
            //This call is required by the SmobilerUserControl.
            InitializeComponent();
        }

        private void classifycontrol_Load(object sender, EventArgs e)
        {
            //if (lblstatus.Text == "1")
            //    classifyDal.Updatesort(lblshort.Text, lblid.Text);
        }

        private void panedit_Press(object sender, EventArgs e)
        {
            Updateclassifycontrol con = new Updateclassifycontrol();
            con.classifyid = lblid.Text;
            con.classtitle = lblname.Text;
            this.Form.ShowDialog(con);
        }

        private void pandel_Press(object sender, EventArgs e)
        {
            MessageBox.Show("点击确定将删除该分类", "删除提示", MessageBoxButtons.OKCancel, (obj, args) =>
            {
                if (args.Result == ShowResult.OK)
                {
                    classifyDal.Delname(lblid.Text);
                    ((MainForm)this.Form).Refshclass();
                }
            });
        }
    }
}